package com.ndky.Demo3;

public class MyClass2 {
    int x = 5;

    public MyClass2(int y){
        System.out.println("构造MyClass");
        x = y;
    }

    public static void main(String[] args) {
        MyClass2 myObj = new MyClass2(5);
        System.out.println(myObj.x);
    }
}
// 输出 构造MyClass
// 输出 5
